package com.example.hp.startproject_411sy.model;

import com.example.hp.startproject_411sy.bean.WeatherResult;
import com.example.hp.startproject_411sy.iface.WeatherListener;
import com.example.hp.startproject_411sy.iface.Weatheriface;
import com.example.hp.startproject_411sy.service.Weather51Service;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by HP on 2017/3/14.
 */

public class Weather51Model implements Weatheriface {
    private Retrofit retrofit;
    private  String BASEURL="http://weather.51wnl.com/weatherinfo/";
    public Weather51Model() {
        retrofit=new Retrofit.Builder().baseUrl(BASEURL).addConverterFactory(GsonConverterFactory.create()).build();
    }

    @Override
    public void getWeather(String cityno, WeatherListener listener) {
        Weather51Service weather51Service=retrofit.create(Weather51Service.class);
        Call<WeatherResult> call=weather51Service.getRusult(cityNumber,1);
        call.enqueue(new Callback<WeatherResult>()){
            @Override


        }
    }
}
